package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;

public class OosDemo {
    public static void main(String[] args) throws IOException {
        String name = "蒋权";
        int age = 18;
        String gender = "男";
        String[] otherInfo = {"shd","usagdu","huaosfdghs","faoihf"};
        Person person = new Person(name,age, otherInfo, gender);

        FileOutputStream fos = new FileOutputStream("123.txt");
        ObjectOutput oos = new ObjectOutputStream(fos);

        oos.writeObject(person);

        System.out.println("写出完成");
        oos.close();

    }
}
